  <script src="http://maps.google.com/maps?file=api&v=2&sensor=true&key=ABQIAAAAOwWCGwRYp76jMzcTHSAZJxRiKXZ7DXrLzxyWAdGBhEoVkrucchSRf8ZK-in_QWw4Q9UXcM6WsNif1Q"
    type="text/javascript">
  </script>
<div id="left">
	<div id="breadcrumb">Where have you been?</div>
	<div class="post">
		<h2>Welcome to uKuda!</h2>
		<p>Are you a travel enthusiast? If not, would you like to be one? Would you like to share your travel stories with others? Would you like to find the perfect travel destination? If you answered yes to one or more of these questions, you've come to the right place! uKuda is a blog-like website that allows people to share their travel experiences with the world and to read about the experiences of others. The name is derived from "kuda", a Russian word that means "where to". So have a look around! Where to next?</p>
	</div>
	<div class="post">
	<h2>Covered Locations</h2>
	<p>The map below marks some locations where our users live (yellow), where they've been to (green), and where they've posted stories about (blue).</p>
	<div class="google_maps_city"><div id="map_canvas" style="width: 587px; height: 350px;"></div></div>
	<script>
		var center;
		var markerLoc;
		var map;
		function zoomMap(locTxt) {

			var zoomLvl = 14;
			  if(map.getZoom() < 10)
			  {
		     	 zoomLvl = 14;
			  }
			  else
			  {
				  zoomLvl = 1;
			  }

			  map.setCenter(locTxt, zoomLvl);
		}
		function initialize() {
		  map = new GMap2(document.getElementById("map_canvas"));
		  map.setCenter(new GLatLng(34.068530, -118.442600), 1);
		  map.setUIToDefault();
		  map.setMapType(G_HYBRID_MAP);	

		  var yellowIcon = new GIcon(G_DEFAULT_ICON);
		  yellowIcon.image = "http://maps.google.com/mapfiles/ms/icons/yellow-dot.png";
		  yellowIcon.iconSize = new GSize(32,32);
		  yellowIcon.iconAnchor = new GPoint(15,31);
		  var redIcon = new GIcon(G_DEFAULT_ICON);
		  redIcon.image = "http://maps.google.com/mapfiles/ms/icons/red-dot.png";
		  redIcon.iconSize = new GSize(32,32);
		  redIcon.iconAnchor = new GPoint(15,31);
		  var blueIcon = new GIcon(G_DEFAULT_ICON);
		  blueIcon.image = "http://maps.google.com/mapfiles/ms/icons/blue-dot.png";
		  blueIcon.iconSize = new GSize(32,32);
		  blueIcon.iconAnchor = new GPoint(15,31);
		  var greenIcon = new GIcon(G_DEFAULT_ICON);
		  greenIcon.image = "http://maps.google.com/mapfiles/ms/icons/green-dot.png";
		  greenIcon.iconSize = new GSize(32,32);
		  greenIcon.iconAnchor = new GPoint(15,31);

		  <?php 
					foreach($profiles as $profile)
					{
						echo 'var profileloc' . $profile['Profile']['id'] . ' = new GLatLng(' . $profile['City']['latitude'] . ',' . $profile['City']['longitude'] . ');';
						echo 'var profile' . $profile['Profile']['id'] . ' = new GMarker(profileloc' . $profile['Profile']['id'] . ',{icon:yellowIcon});';
						echo 'GEvent.addListener(profile' . $profile['Profile']['id'] . ',"click", function() {
		profile' . $profile['Profile']['id'] . ".openInfoWindowHtml('" . 'This is where <b>' . $html->link($profile['User']['username'], '/profiles/view/' . $profile['Profile']['id'])
		 . '</b> lives!<br /><br />' . $html->link($profile['City']['name'],
	  array('controller'=> 'cities', 'action'=>'view', $profile['City']['id'])) . '<br><a href="javascript:void();" onClick="zoomMap(new GLatLng('. $profile['City']['latitude'] . ',' . $profile['City']['longitude'] . '))">Zoom In/Zoom Out</a>' . "');" .
  '});';
						echo 'map.addOverlay(profile' . $profile['Profile']['id'] . ');';
					 }
					 
					 foreach($visited as $visit)
					 {
					 	echo 'var visitloc' . $visit['Visited']['id'] . ' = new GLatLng(' . $visit['City']['latitude'] . ',' . $visit['City']['longitude'] . ');';
						echo 'var visit' . $visit['Visited']['id'] . ' = new GMarker(visitloc' . $visit['Visited']['id'] . ',{icon:greenIcon});';
						echo 'GEvent.addListener(visit' . $visit['Visited']['id'] . ',"click", function() {
		visit' . $visit['Visited']['id'] . ".openInfoWindowHtml('" . '<b>' . $html->link($visit['User']['username'], '/users/view/' . $visit['User']['id'])
		 . '</b> has been to: <br /><br />' . $html->link($visit['City']['name'],
	  array('controller'=> 'cities', 'action'=>'view', $visit['City']['id'])) . '<br><a href="javascript:void();" onClick="zoomMap(new GLatLng('. $visit['City']['latitude'] . ',' . $visit['City']['longitude'] . '))">Zoom In/Zoom Out</a>' . "');" .
  '});';
						echo 'map.addOverlay(visit' . $visit['Visited']['id'] . ');';
			
					 }
					 
		?>

		
		<?php 
				foreach($stories as $story)
				{
					$story['Story']['message'] = str_replace("'","\'", $story['Story']['message']);
					$story['Story']['title'] = str_replace("'","\'", $story['Story']['title']);
					
					echo 'var storyloc' . $story['Story']['id'] . ' = new GLatLng(' . $story['Story']['latitude'] . ',' . $story['Story']['longitude'] . ');';
					echo 'var story' . $story['Story']['id'] . ' = new GMarker(storyloc' . $story['Story']['id'] . ',{icon:blueIcon});';
					echo 'GEvent.addListener(story' . $story['Story']['id'] . ',"click", function() {
	story' . $story['Story']['id'] . ".openInfoWindowHtml('" . '<div style="width:200px; overflow:none;"><b>' . $html->link($story['Story']['title'], '/stories/view/' . $story['Story']['id'])
		 		. '</b> by ' . $html->link($story['User']['username'], '/users/view/' . $story['User']['id']) . '</div><br />' . 
		 		'<br /><div width="200px" style="width:200px; overflow:none;">' . ((strlen($story['Story']['message']) > 200) ? substr($story['Story']['message'],0,200) . '...' : $story['Story']['message'])
		 		 . '</div><br /><br />' . $html->link('See More','/stories/view/' . $story['Story']['id']) .
"');});";
					echo 'map.addOverlay(story' . $story['Story']['id'] . ');';
				 }
				 
				 
	?>
		}		
	</script><p></p>
	</div>
	<div class="post">
		<h2>How uKuda works:</h2>
		<p>Everyone can register with uKuda for FREE. This allows you to gain access to a customizable user profile. You can share your travel experiences with others through stories.  Users are also able to interact with each other by adding friends and posting messages. The goal is to build a united community of travel enthusiasts. If you like what you see, please <a href="/users/add">register</a> for a free account. Each page will contain applicable instructions that will guide your experience here at uKuda.</p>
		<h2>Why is uKuda better than other travel websites?</h2>
		<p>uKuda is different from other travel websites because users are able to learn about travel destinations all over the world from real people.  Through uKuda, it is easier to connect to other users and gain insight from locals as well as experienced travelers.</p>
	</div>
</div>
<div id="sidebar">

<h2><?php __('Random Users:');?></h2>
	
					<table style="border:0" width="100%" align="center">
					<tr>
					<?php 
					    $i=0;
						foreach($users as $user)
						{ 
						 	$i++;
						 	echo '<td width="30px"><div style="height: 47px;overflow: none;">';
							echo $extendedhtml->image('/images/thumb/' . $user['Profile']['Image']['id'] . '/?w=40&h=40', array('class' => 'centeralign'), '/profiles/view/' . $user['Profile']['id'], array());
							echo '</div>';
							echo $html->link($user['User']['username'], '/profiles/view/' . $user['Profile']['id']);
						 	echo '</td>';
						 	
						 	if($i % 2 == 0)
						 	 echo '</tr><tr>'; /* only two per line, because long names won't fit :( */	
						}
					?>
					</tr>
					</table>	
	
	
	<h2><?php __('Random Cities:');?></h2>
	
					<table style="border:0" width="100%" align="center">
					<tr>
					<?php 
					    $i=0;
						foreach($cities as $city)
						{
						 	$i++;
						 	echo '<li>';
							echo $html->link($city['City']['name'], '/cities/view/' . $city['City']['id']);
						 	echo '</li>';
						 	
						}
					?>
					</tr>
					</table>	
</div>

<script type="text/javascript">
 initialize();
</script>